import java.math.BigDecimal;
import java.util.logging.Logger;

public class CashCard extends BankCard 
{
  public CashCard(String cardNo, String cardDate) 
  {
    super(cardNo, cardDate);
  }

  @Override
  boolean rule(BigDecimal amount) 
  {
    return(true);
  }

  Logger logger = Logger.getLogger(CashCard.class.getName());
  /**
   * 提现
   *
   * @param orderId 单号
   * @param amount  金额
   * @return 状态码 0000成功、0001失败、0002重复
   */
  public String withdrawal(String orderId, BigDecimal amount) 
  {
    // 模拟支付成功
    this.logger.info("提现成功，单号：" + orderId + " 金额：" + amount);
    return(super.negative(orderId, amount));
  }

  /**
   * 储蓄
   *
   * @param orderId 单号
   * @param amount  金额
   */
  public String recharge(String orderId, BigDecimal amount) 
  {
    // 模拟充值成功
    this.logger.info("储蓄成功，单号：" + orderId + " 金额：" + amount);
    return(super.positive(orderId, amount));
  }
}
